package com.xx.sg.own.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sg_communication_terminal")
public class CommunicationTerminal {

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    //设备号
    @TableField(value = "dev_id")
    private String devId;

    @TableField(value = "user_id")
    private String userId;

    //经度
    @TableField(value = "latitude")
    private String latitude;

    //纬度
    @TableField(value = "longitude")
    private String longitude;

    //厂家
    @TableField(value = "manufacturer")
    private String manufacturer;

    //型号
    @TableField(value = "model")
    private String model;

    //队伍
    @TableField(value = "team")
    private String team;

    @TableField(exist = false)
    private FacilityFireTeam fireTeam;

    //机身号码
    @TableField(value = "serial_no")
    private String serialNo;

    //下级部门名称
    @TableField(value = "subordinate_dept_name")
    private String subordinateDeptName;

    //部门
    @TableField(value = "dept_id")
    private String deptId;

    @TableField(exist = false)
    private Dept dept;

    @TableField(value = "time")
    private String time;
    @TableField(value = "data_status")
    private String dataStatus;
    @TableField(value = "data_text")
    private String dataText;
    @TableField(value = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @TableField(value = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private User user;
    @TableField(exist = false)
    private String userName;

}
